/* Jtheberg OS Global Styles */
:root {
    --os-bg: #000;
    --dock-bg: rgba(255, 255, 255, 0.2);
    --window-bg: rgba(28, 28, 30, 0.95);
    --text-color: #fff;
    --accent-color: #007aff;
    --content-bg: rgba(0, 0, 0, 0.3);
    --card-bg: rgba(44, 44, 46, 0.6);
    --input-bg: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.1);
}

body, html {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling on the desktop body */
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
}

#main-body {
    padding: 0 !important;
    margin: 0 !important;
}

.os-desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #000;
    color: var(--text-color);
}

/* Background Video */
#bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* Top Bar */
.os-topbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 14px;
    user-select: none;
}

.os-topbar-left, .os-topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.os-logo {
    font-weight: 600;
}

.os-user-menu img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    vertical-align: middle;
}

/* Dock */
.os-dock-container {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 100;
    pointer-events: none; /* Let clicks pass through around the dock */
}

.os-dock {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    pointer-events: auto; /* Re-enable clicks on dock */
}

.os-dock-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.os-dock-item:hover {
    transform: scale(1.1) translateY(-10px);
    background: rgba(255, 255, 255, 0.2);
}

.os-dock-item .tooltip {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.os-dock-item:hover .tooltip {
    opacity: 1;
}

/* Windows */
.os-workspace {
    position: absolute;
    top: 30px;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    pointer-events: none;
}

.os-window {
    position: absolute;
    background: var(--window-bg);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    animation: popIn 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes popIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.os-window.active {
    z-index: 50;
    border-color: rgba(255, 255, 255, 0.2);
}

.os-window-header {
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: default;
    flex-shrink: 0;
}

.os-window-controls {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.win-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close-btn { background: #ff5f56; }
.min-btn { background: #ffbd2e; }
.max-btn { background: #27c93f; }

.os-window-title {
    flex-grow: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
    margin-right: 50px;
}

.os-window-content {
    flex: 1;
    padding: 0; /* Let inner content handle padding */
    overflow-y: auto;
    color: #eee;
    position: relative;
}

/* WHMCS Content Overrides for Window Mode */
.os-window-content .header {
    background: transparent !important;
    margin-bottom: 0 !important;
}

.os-window-content .navbar-main {
    margin-bottom: 20px;
}

.os-window-content section#main-body {
    background: transparent !important;
}

/* Main App Window Specifics */
#main-app-window {
    top: 50px;
    left: 5%;
    width: 90%;
    height: 85%;
    border-radius: 12px;
}

/* Stats Grid inside Window */
.os-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
}

.os-stat-card {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: background 0.2s;
    text-decoration: none;
    color: white;
    display: block;
}

.os-stat-card:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
    color: white;
}

.os-stat-card i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.os-stat-card .stat-value {
    font-size: 20px;
    font-weight: bold;
    display: block;
}

.os-stat-card .stat-label {
    font-size: 12px;
    opacity: 0.7;
}

/* Store Styles */
.store-hero {
    text-align: center;
    padding: 40px 20px;
}

.store-hero i {
    font-size: 48px;
    color: #27c93f;
    margin-bottom: 20px;
}

.store-btn {
    display: inline-block;
    background: #27c93f;
    color: white;
    padding: 10px 25px;
    border-radius: 20px;
    text-decoration: none;
    margin-top: 20px;
    font-weight: bold;
}

.store-btn:hover {
    background: #20a532;
    color: white;
    text-decoration: none;
}

/* Dark Mode Overrides for Standard WHMCS Elements */
.os-window-content .card {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    color: #fff;
}

.os-window-content .card-header,
.os-window-content .card-footer {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-color: var(--border-color);
}

.os-window-content .table {
    color: #eee;
}

.os-window-content .table thead th {
    border-bottom: 2px solid var(--border-color);
    color: #aaa;
}

.os-window-content .table td, 
.os-window-content .table th {
    border-top: 1px solid var(--border-color);
}

.os-window-content .form-control {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    color: #fff;
}

.os-window-content .form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: var(--accent-color);
}

.os-window-content .btn-default {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.os-window-content .btn-default:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.os-window-content h1, 
.os-window-content h2, 
.os-window-content h3, 
.os-window-content h4, 
.os-window-content h5, 
.os-window-content h6 {
    color: #fff;
}

.os-window-content .text-muted {
    color: #aaa !important;
}

.os-window-content a {
    color: var(--accent-color);
}

.os-window-content .list-group-item {
    background-color: transparent;
    border-color: var(--border-color);
    color: #fff;
}

.os-window-content .alert {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.os-window-content .alert-info { border-left: 4px solid #17a2b8; }
.os-window-content .alert-success { border-left: 4px solid #28a745; }
.os-window-content .alert-warning { border-left: 4px solid #ffc107; }
.os-window-content .alert-danger { border-left: 4px solid #dc3545; }

/* Modal Dark Mode */
.modal-content {
    background-color: #2c2c2e;
    color: #fff;
}
.modal-header, .modal-footer {
    border-color: rgba(255,255,255,0.1);
}
.close {
    color: #fff;
    text-shadow: none;
}

/* Sidebar Dark Mode */
.os-window-content .sidebar .card {
    background-color: rgba(0,0,0,0.2) !important;
}
.os-window-content .sidebar .list-group-item {
    background-color: transparent;
}
.os-window-content .sidebar .list-group-item:hover {
    background-color: rgba(255,255,255,0.05);
}
.os-window-content .sidebar .badge {
    background-color: var(--accent-color);
    color: #fff;
}
